package com.fbms.module.system.dao;

import com.fbms.module.system.bean.dto.SysMenuDTO;
import com.fbms.module.system.bean.entity.SysMenu;
import com.github.yulichang.base.MPJBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 类描述：系统菜单
 *
 * @ClassName SysMenu
 * @Author HappyBoy
 * @Date 2023-04-03 10:30
 **/
@Mapper
public interface SysMenuMapper extends MPJBaseMapper<SysMenu> {

    /**
     * 根据角色Id 查询菜单列表
     * @param roleId 角色Id
     * @return 菜单列表
     */
    @Select("select b.* from sys_role_menu a left join sys_menu b on a.menu_id = b.id and role_id = #{roleId} ")
    List<SysMenuDTO> selectMenuListByRoleId(@Param(value = "roleId")String roleId);
}
